class_name BlockWater
extends BaseBlock


func generate():
	generate_uv()
	generate_indice()
	generate_vertex()


func generate_uv():
	uv.append(get_uv(32))
	uv.append(get_uv(32))
	uv.append(get_uv(32))
	uv.append(get_uv(32))
	uv.append(get_uv(32))
	uv.append(get_uv(32))

func generate_indice():
	var idx1:PackedInt32Array
	var idx2:PackedInt32Array
	var idx_up:PackedInt32Array
	idx1.push_back(0);idx1.push_back(1);idx1.push_back(2)
	idx1.push_back(2);idx1.push_back(1);idx1.push_back(3)
	idx2.push_back(0);idx2.push_back(2);idx2.push_back(1)
	idx2.push_back(1);idx2.push_back(2);idx2.push_back(3)
	
	idx_up.push_back(0);idx_up.push_back(1);idx_up.push_back(2)
	idx_up.push_back(2);idx_up.push_back(1);idx_up.push_back(3)

	idx_up.push_back(0);idx_up.push_back(2);idx_up.push_back(1)
	idx_up.push_back(2);idx_up.push_back(3);idx_up.push_back(1)
	for i in 6:
		indice.push_back(idx_up)
		indice.push_back(idx1)
		indice.push_back(idx1)
		indice.push_back(idx2)
		indice.push_back(idx2)
		indice.push_back(idx2)
